--[[
FilePath: \Lua\View\UIHeroCollect\UIHeroCollectReward.lua
英雄集结每日奖励提示框
--]]

require 'View/UIBase/UIBase'

UIHeroCollectReward = UIBase.New(PanelResNames.UIHeroCollectReward)
local _M = UIHeroCollectReward

_M.hasInit = false

function _M.Init()
    UIBase.Init(_M)
end

-- 创建回调
function _M:OnCreate()
    if not _M.hasInit then
        _M.hasInit = true
        self.btnBgClose = self:GetChild("bgClose");
        self.title = self:GetChild("title")
        self.text = self:GetChild("text")
        self.endtips = self:GetChild("endtips")
        self.num = self:GetChild("num")

        self:showLanguage()
        self:addEvent()
    end
end

function _M:showLanguage()
    self.title.text = getLanguage("ActivityDesc1050105");
    self.text.text = getLanguage("ActivityDesc1050106");
    self.endtips.text = getLanguage("ActivityDesc1050107");
    local num = G.dataTable["t_global"][tostring(360)].f_int_value;
    self.num.text = tostring(num);
end

function _M:addEvent()
    self.btnBgClose.onClick:Add(self.OnClose)
end

function _M:removeEvent()
    self.btnBgClose.onClick:Remove(self.OnClose)
end

function _M.OnClose()
    closeUI(PanelResNames.UIHeroCollectReward);
end

function _M:OnEnable()
end

function _M:OnDisable()
end

function _M:OnDestroy()
    self:removeEvent();
    _M.hasInit = false;
end

return _M;
